

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>rados -- rados 对象存储工具 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="ceph-post-file -- 把文件上传给 ceph 开发者" href="../ceph-post-file/" />
    <link rel="prev" title="osdmaptool -- ceph osd 运行图操作工具" href="../osdmaptool/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../../rados/">Ceph 存储集群</a></li>
          <li class="breadcrumb-item"><a href="../../../rados/man/">对象存储手册页</a></li>
      <li class="breadcrumb-item active">rados -- rados 对象存储工具</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/man/8/rados.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../rados/configuration/">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/operations/">运维</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../rados/man/">    手册页</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../ceph-volume/">ceph-volume -- Ceph OSD 部署和检查工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-volume-systemd/">ceph-volume-systemd -- systemd ceph-volume 辅助工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph/">ceph -- Ceph 管理工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-authtool/">ceph-authtool -- ceph 密钥环操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-clsinfo/">ceph-clsinfo -- 查看类对象信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-conf/">ceph-conf -- ceph 配置文件工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-debugpack/">ceph-debugpack -- ceph 调试信息打包工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-dencoder/">ceph-dencoder -- ceph 编码器/解码器工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-mon/">ceph-mon -- ceph 监视器守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-osd/">ceph-osd -- ceph 对象存储守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-kvstore-tool/">ceph-kvstore-tool -- ceph 的 kvstore 操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-run/">ceph-run -- 发生核心转储后重启守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-syn/">ceph-syn -- ceph 的人造负载生成器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crushdiff/">crushdiff -- ceph crush 图测试工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crushtool/">crushtool -- CRUSH 图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../librados-config/">librados-config -- 显示关于 librados 的信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monmaptool/">monmaptool -- ceph 监视器运行图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../osdmaptool/">osdmaptool -- ceph osd 运行图操作工具</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">rados -- rados 对象存储工具</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">提纲</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">描述</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">全局选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">压力测试选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#load-gen">Load gen 选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">缓存存储池选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#omap">OMAP 选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">通用选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">全局命令</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id8">特定于存储池的命令</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id9">实例</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id10">使用范围</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id11">参考</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-post-file/">ceph-post-file -- 把文件上传给 ceph 开发者</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="rados-rados">
<h1>rados -- rados 对象存储工具<a class="headerlink" href="#rados-rados" title="Permalink to this heading"></a></h1>
<section id="id1">
<h2>提纲<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>rados</strong> [ <em>options</em> ] [ <em>command</em> ]</div>
</div>
</section>
<section id="id2">
<h2>描述<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p><strong>rados</strong> 工具可操纵 Ceph 对象存储集群（ RADOS ），是 Ceph
分布式存储系统的一部分。</p>
</section>
<section id="id3">
<h2>全局选项<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-object-locator">
<span class="sig-name descname"><span class="pre">--object-locator</span></span><span class="sig-prename descclassname"> <span class="pre">object_locator</span></span><a class="headerlink" href="#cmdoption-rados-object-locator" title="Permalink to this definition"></a></dt>
<dd><p>设置操作的 object_locator （对象定位器？）。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-p">
<span id="cmdoption-rados-pool"></span><span class="sig-name descname"><span class="pre">-p</span></span><span class="sig-prename descclassname"> <span class="pre">pool</span></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--pool</span></span><span class="sig-prename descclassname"> <span class="pre">pool</span></span><a class="headerlink" href="#cmdoption-rados-p" title="Permalink to this definition"></a></dt>
<dd><p>操作指定的存储池。大多数命令都得指定此参数。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-target-pool">
<span class="sig-name descname"><span class="pre">--target-pool</span></span><span class="sig-prename descclassname"> <span class="pre">pool</span></span><a class="headerlink" href="#cmdoption-rados-target-pool" title="Permalink to this definition"></a></dt>
<dd><p>按名字指定目标存储池。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-pgid">
<span class="sig-name descname"><span class="pre">--pgid</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-pgid" title="Permalink to this definition"></a></dt>
<dd><p>作为 <code class="docutils literal notranslate"><span class="pre">--pool</span></code> 的外加参数， <code class="docutils literal notranslate"><span class="pre">--pgid</span></code> 是让用户指定 PG id
的，然后命令就径直导向此 PG 。加上这个选项，用户就可以把某些命令（如 <code class="docutils literal notranslate"><span class="pre">ls</span></code> ）的范围限定于指定 PG 。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-N">
<span id="cmdoption-rados-n"></span><span id="cmdoption-rados-namespace"></span><span class="sig-name descname"><span class="pre">-N</span></span><span class="sig-prename descclassname"> <span class="pre">namespace</span></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--namespace</span></span><span class="sig-prename descclassname"> <span class="pre">namespace</span></span><a class="headerlink" href="#cmdoption-rados-N" title="Permalink to this definition"></a></dt>
<dd><p>指定要给对象用的 rados 命名空间。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-all">
<span class="sig-name descname"><span class="pre">--all</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-all" title="Permalink to this definition"></a></dt>
<dd><p>ls 时加此选项来罗列所有命名空间里的对象。
放入 CEPH_ARGS 环境变量可以成为默认值。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-default">
<span class="sig-name descname"><span class="pre">--default</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-default" title="Permalink to this definition"></a></dt>
<dd><p>ls 时加此选项来罗列默认命名空间里的对象。
--all 在环境变量里时，优先级高于 --all 。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-s">
<span id="cmdoption-rados-snap"></span><span class="sig-name descname"><span class="pre">-s</span></span><span class="sig-prename descclassname"> <span class="pre">snap</span></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--snap</span></span><span class="sig-prename descclassname"> <span class="pre">snap</span></span><a class="headerlink" href="#cmdoption-rados-s" title="Permalink to this definition"></a></dt>
<dd><p>从指定的存储池快照读出。适用于所有与存储池相关的读操作。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-create">
<span class="sig-name descname"><span class="pre">--create</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-create" title="Permalink to this definition"></a></dt>
<dd><p>创建指定的存储池或目录。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-i">
<span class="sig-name descname"><span class="pre">-i</span></span><span class="sig-prename descclassname"> <span class="pre">infile</span></span><a class="headerlink" href="#cmdoption-rados-i" title="Permalink to this definition"></a></dt>
<dd><p>指定输入文件，其内容将作为此命令的载荷发送给监视器集群。
仅适用于部分监视器命令。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-m">
<span class="sig-name descname"><span class="pre">-m</span></span><span class="sig-prename descclassname"> <span class="pre">monaddress[:port]</span></span><a class="headerlink" href="#cmdoption-rados-m" title="Permalink to this definition"></a></dt>
<dd><p>连接指定监视器（而非通过 ceph.conf 查找）。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-b">
<span class="sig-name descname"><span class="pre">-b</span></span><span class="sig-prename descclassname"> <span class="pre">block_size</span></span><a class="headerlink" href="#cmdoption-rados-b" title="Permalink to this definition"></a></dt>
<dd><p>设置块尺寸，适用于 put/get/append 操作、及写入压力测试。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-striper">
<span class="sig-name descname"><span class="pre">--striper</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-striper" title="Permalink to this definition"></a></dt>
<dd><p>使用 rados 的条带化 API 而非默认的，支持的操作有 stat 、
get 、 put 、 append 、 truncate 、 rm 、 ls 以及所有与
xattr 相关的操作。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-O">
<span id="cmdoption-rados-o"></span><span id="cmdoption-rados-object-size"></span><span class="sig-name descname"><span class="pre">-O</span></span><span class="sig-prename descclassname"> <span class="pre">object_size</span></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--object-size</span></span><span class="sig-prename descclassname"> <span class="pre">object_size</span></span><a class="headerlink" href="#cmdoption-rados-O" title="Permalink to this definition"></a></dt>
<dd><p>在做写入压力测试的时候，设置 put/get 操作的对象尺寸。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-max-objects">
<span class="sig-name descname"><span class="pre">--max-objects</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-max-objects" title="Permalink to this definition"></a></dt>
<dd><p>设置写压力测试的最大对象数。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-lock-cookie">
<span class="sig-name descname"><span class="pre">--lock-cookie</span></span><span class="sig-prename descclassname"> <span class="pre">locker-cookie</span></span><a class="headerlink" href="#cmdoption-rados-lock-cookie" title="Permalink to this definition"></a></dt>
<dd><p>申请咨询锁（ lock get 命令）时将设置锁 cookie 。
如果此 cookie 不是空的，那么释放锁时必须给 lock break 命令加上这个选项，为的是找到正确的锁。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-target-locator">
<span class="sig-name descname"><span class="pre">--target-locator</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-target-locator" title="Permalink to this definition"></a></dt>
<dd><p>与 cp 命令一起用，可指定新对象的定位符。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-target-nspace">
<span class="sig-name descname"><span class="pre">--target-nspace</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-target-nspace" title="Permalink to this definition"></a></dt>
<dd><p>与 cp 命令一起用，可指定新对象的命名空间。</p>
</dd></dl>

</section>
<section id="id4">
<h2>压力测试选项<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h2>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-t">
<span id="cmdoption-rados-concurrent-ios"></span><span class="sig-name descname"><span class="pre">-t</span></span><span class="sig-prename descclassname"> <span class="pre">N</span></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--concurrent-ios</span></span><span class="sig-prename descclassname"><span class="pre">=N</span></span><a class="headerlink" href="#cmdoption-rados-t" title="Permalink to this definition"></a></dt>
<dd><p>设置并发 I/O 操作的数量。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-show-time">
<span class="sig-name descname"><span class="pre">--show-time</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-show-time" title="Permalink to this definition"></a></dt>
<dd><p>输出时用日期、时间作前缀。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-no-verify">
<span class="sig-name descname"><span class="pre">--no-verify</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-no-verify" title="Permalink to this definition"></a></dt>
<dd><p>不要校验读对象的内容。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-write-object">
<span class="sig-name descname"><span class="pre">--write-object</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-write-object" title="Permalink to this definition"></a></dt>
<dd><p>向对象们写入内容。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-write-omap">
<span class="sig-name descname"><span class="pre">--write-omap</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-write-omap" title="Permalink to this definition"></a></dt>
<dd><p>向 omap 写入内容。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-write-xattr">
<span class="sig-name descname"><span class="pre">--write-xattr</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-write-xattr" title="Permalink to this definition"></a></dt>
<dd><p>向扩展属性写入内容。</p>
</dd></dl>

</section>
<section id="load-gen">
<h2>Load gen 选项<a class="headerlink" href="#load-gen" title="Permalink to this heading"></a></h2>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-num-objects">
<span class="sig-name descname"><span class="pre">--num-objects</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-num-objects" title="Permalink to this definition"></a></dt>
<dd><p>对象总量。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-min-object-size">
<span class="sig-name descname"><span class="pre">--min-object-size</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-min-object-size" title="Permalink to this definition"></a></dt>
<dd><p>最小对象尺寸。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-max-object-size">
<span class="sig-name descname"><span class="pre">--max-object-size</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-max-object-size" title="Permalink to this definition"></a></dt>
<dd><p>最大对象尺寸。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-min-op-len">
<span class="sig-name descname"><span class="pre">--min-op-len</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-min-op-len" title="Permalink to this definition"></a></dt>
<dd><p>操作的最小 IO 尺寸。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-max-op-len">
<span class="sig-name descname"><span class="pre">--max-op-len</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-max-op-len" title="Permalink to this definition"></a></dt>
<dd><p>操作的最大 IO 尺寸。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-max-ops">
<span class="sig-name descname"><span class="pre">--max-ops</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-max-ops" title="Permalink to this definition"></a></dt>
<dd><p>最大操作量。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-max-backlog">
<span class="sig-name descname"><span class="pre">--max-backlog</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-max-backlog" title="Permalink to this definition"></a></dt>
<dd><p>最大积压尺寸。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-read-percent">
<span class="sig-name descname"><span class="pre">--read-percent</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-read-percent" title="Permalink to this definition"></a></dt>
<dd><p>读操作的百分比。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-target-throughput">
<span class="sig-name descname"><span class="pre">--target-throughput</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-target-throughput" title="Permalink to this definition"></a></dt>
<dd><p>目标吞吐量（按字节）。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-run-length">
<span class="sig-name descname"><span class="pre">--run-length</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-run-length" title="Permalink to this definition"></a></dt>
<dd><p>总时长（按秒）。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-offset-align">
<span class="sig-name descname"><span class="pre">--offset-align</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-offset-align" title="Permalink to this definition"></a></dt>
<dd><p>对齐随机操作偏移量的边界。</p>
</dd></dl>

</section>
<section id="id5">
<h2>缓存存储池选项<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h2>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-with-clones">
<span class="sig-name descname"><span class="pre">--with-clones</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-with-clones" title="Permalink to this definition"></a></dt>
<dd><p>刷回或赶回对象时包括克隆品。</p>
</dd></dl>

</section>
<section id="omap">
<h2>OMAP 选项<a class="headerlink" href="#omap" title="Permalink to this heading"></a></h2>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-omap-key-file">
<span class="sig-name descname"><span class="pre">--omap-key-file</span></span><span class="sig-prename descclassname"> <span class="pre">file</span></span><a class="headerlink" href="#cmdoption-rados-omap-key-file" title="Permalink to this definition"></a></dt>
<dd><p>从一个文件读取 omap 键名。</p>
</dd></dl>

</section>
<section id="id6">
<h2>通用选项<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h2>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-c">
<span id="cmdoption-rados-conf"></span><span class="sig-name descname"><span class="pre">-c</span></span><span class="sig-prename descclassname"> <span class="pre">FILE</span></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--conf</span></span><span class="sig-prename descclassname"> <span class="pre">FILE</span></span><a class="headerlink" href="#cmdoption-rados-c" title="Permalink to this definition"></a></dt>
<dd><p>从指定配置文件读取配置。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-id">
<span class="sig-name descname"><span class="pre">--id</span></span><span class="sig-prename descclassname"> <span class="pre">ID</span></span><a class="headerlink" href="#cmdoption-rados-id" title="Permalink to this definition"></a></dt>
<dd><p>设置自己名字的 ID 部分。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-0">
<span id="cmdoption-rados-name"></span><span class="sig-name descname"><span class="pre">-n</span></span><span class="sig-prename descclassname"> <span class="pre">TYPE.ID</span></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--name</span></span><span class="sig-prename descclassname"> <span class="pre">TYPE.ID</span></span><a class="headerlink" href="#cmdoption-rados-0" title="Permalink to this definition"></a></dt>
<dd><p>设置 cephx 用户名。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-cluster">
<span class="sig-name descname"><span class="pre">--cluster</span></span><span class="sig-prename descclassname"> <span class="pre">NAME</span></span><a class="headerlink" href="#cmdoption-rados-cluster" title="Permalink to this definition"></a></dt>
<dd><p>设置集群名（默认： ceph ）</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-setuser">
<span class="sig-name descname"><span class="pre">--setuser</span></span><span class="sig-prename descclassname"> <span class="pre">USER</span></span><a class="headerlink" href="#cmdoption-rados-setuser" title="Permalink to this definition"></a></dt>
<dd><p>给指定用户或 UID 设置 uid （并给用户的 gid 设置 gid）</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-setgroup">
<span class="sig-name descname"><span class="pre">--setgroup</span></span><span class="sig-prename descclassname"> <span class="pre">GROUP</span></span><a class="headerlink" href="#cmdoption-rados-setgroup" title="Permalink to this definition"></a></dt>
<dd><p>给指定用户组或 GID 设置 gid 。</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-rados-version">
<span class="sig-name descname"><span class="pre">--version</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-rados-version" title="Permalink to this definition"></a></dt>
<dd><p>显示版本并退出。</p>
</dd></dl>

</section>
<section id="id7">
<h2>全局命令<a class="headerlink" href="#id7" title="Permalink to this heading"></a></h2>
<dl class="simple">
<dt><strong class="command">lspools</strong></dt><dd><p>罗列对象存储池</p>
</dd>
<dt><strong class="command">df</strong></dt><dd><p>显示利用率统计信息，显示整个系统以及各存储池的磁盘空间（字节数）、对象数量。</p>
</dd>
<dt><strong class="command">list-inconsistent-pg</strong> <em>pool</em></dt><dd><p>罗列指定存储池内不一致的归置组。</p>
</dd>
<dt><strong class="command">list-inconsistent-obj</strong> <em>pgid</em></dt><dd><p>罗列指定 PG 内不一致的对象。</p>
</dd>
<dt><strong class="command">list-inconsistent-snapset</strong> <em>pgid</em></dt><dd><p>罗列指定 PG 内不一致的 snapset 。</p>
</dd>
</dl>
</section>
<section id="id8">
<h2>特定于存储池的命令<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h2>
<dl class="simple">
<dt><strong class="command">get</strong> <em>name</em> <em>outfile</em></dt><dd><p>从集群读出名为 name 的对象、并把它写入 outfile 。</p>
</dd>
<dt><strong class="command">put</strong> <em>name</em> <em>infile</em> [--offset offset]</dt><dd><p>把 infile 的内容写入集群内名为 name 的对象、从偏移量 <em>offset</em> （默认为 0 ）处写起。
<strong>警告：</strong>put 命令创建的是单个 RADOS 对象，尺寸和你的输入文件完全一样。
你如果不能保证对象的尺寸合理且一致，最好改用 RGW/S3 、 CephFS 或 RBD ，
否则实际运行情况和你期望的会有出入。</p>
</dd>
<dt><strong class="command">append</strong> <em>name</em> <em>infile</em></dt><dd><p>把 infile 的内容追加给集群内名为 name 的对象。</p>
</dd>
<dt><strong class="command">rm</strong> [--force-full] <em>name</em> …</dt><dd><p>删除名为 name 的对象。集群被标记为 full 时需加上 <code class="docutils literal notranslate"><span class="pre">--force-full</span></code> 选项。</p>
</dd>
<dt><strong class="command">listwatchers</strong> <em>name</em></dt><dd><p>罗列此对象名的关注者。</p>
</dd>
<dt><strong class="command">ls</strong> <em>outfile</em></dt><dd><p>罗列指定存储池内的对象，并把名单写入 outfile 文件。</p>
</dd>
<dt><strong class="command">lssnap</strong></dt><dd><p>罗列指定存储池的快照。</p>
</dd>
<dt><strong class="command">clonedata</strong> <em>srcname</em> <em>dstname</em> --object-locator <em>key</em></dt><dd><p>从 <em>srcname</em> 到 <em>dstname</em> 克隆对象字节数据，两个对象都必须以定位符关键词 <em>key</em>
（通常是 <em>srcname</em> 或 <em>dstname</em> ）存储。不会复制或克隆对象属性和 omap 键。</p>
</dd>
<dt><strong class="command">mksnap</strong> <em>foo</em></dt><dd><p>创建存储池快照，名为 <em>foo</em> 。</p>
</dd>
<dt><strong class="command">rmsnap</strong> <em>foo</em></dt><dd><p>删除名为 <em>foo</em> 的存储池快照。</p>
</dd>
<dt><strong class="command">bench</strong> <em>seconds</em> <em>mode</em> [ -b <em>objsize</em> ] [ -t <em>threads</em> ]</dt><dd><p>压力测试 <em>seconds</em> 秒。 <em>mode</em> 可以是 <em>write</em> 、 <em>seq</em> 或 <em>rand</em> 。 <em>seq</em> 和 <em>rand</em> 分别是顺序读、随机读压力测试，要想做读压力测试，先得加 <em>--no-cleanup</em> 选项做一次写压力测试。默认对象尺寸是 4 MB ，默认的模拟线程数（并行写操作）为 16 。<em>--run-name &lt;label&gt;</em> 选项适用于多个客户端并行测试以评估最大载荷。 <em>&lt;label&gt;</em> 表示任意对象名，默认为 “benchmark_last_metadata” ，且作为“读”和“写”操作的底层对象名。
注： -b <em>objsize</em> 仅适用于 <em>write</em> 模式。
注： <em>write</em> 和 <em>seq</em> 必须运行在相同的主机上，否则 <em>write</em> 所创建对象的名字不能被 <em>seq</em> 所接受。</p>
</dd>
<dt><strong class="command">cleanup</strong> [ --run-name <em>run_name</em> ] [ --prefix <em>prefix</em> ]</dt><dd><p>清理先前的基准测试操作。
注意：默认的 run-name 是 <code class="docutils literal notranslate"><span class="pre">benchmark_last_metadata</span></code></p>
</dd>
<dt><strong class="command">listxattr</strong> <em>name</em></dt><dd><p>罗列一个对象的所有扩展属性。</p>
</dd>
<dt><strong class="command">getxattr</strong> <em>name</em> <em>attr</em></dt><dd><p>获取某一对象的扩展属性 <em>attr</em> 的值。</p>
</dd>
<dt><strong class="command">setxattr</strong> <em>name</em> <em>attr</em> <em>value</em></dt><dd><p>设置某一对象的扩展属性，把扩展属性 <em>attr</em> 的值设置为 <em>value</em> 。</p>
</dd>
<dt><strong class="command">rmxattr</strong> <em>name</em> <em>attr</em></dt><dd><p>删除某一对象的扩展属性 <em>attr</em> 。</p>
</dd>
<dt><strong class="command">stat</strong> <em>name</em></dt><dd><p>获取指定对象的 stat 信息（即 mtime 、 size ）。</p>
</dd>
<dt><strong class="command">stat2</strong> <em>name</em></dt><dd><p>获取指定对象的 stat 信息（与 stat 类似，但是时间精度更高）。</p>
</dd>
<dt><strong class="command">listomapkeys</strong> <em>name</em></dt><dd><p>罗列 name 对象的对象映射图内存储的所有键。</p>
</dd>
<dt><strong class="command">listomapvals</strong> <em>name</em></dt><dd><p>罗列 name 对象的对象映射图内存储的所有键值对。值会被转储为十六进制。</p>
</dd>
<dt><strong class="command">getomapval</strong> [ --omap-key-file <em>file</em> ] <em>name</em> <em>key</em> [ <em>out-file</em> ]</dt><dd><p>把 name 对象的对象映射图内 key 的值转储为十六进制。
如果没有提供可选参数 <em>out-file</em> ，
这个值就会写到标准输出。</p>
</dd>
<dt><strong class="command">setomapval</strong> [ --omap-key-file <em>file</em> ] <em>name</em> <em>key</em> [ <em>value</em> ]</dt><dd><p>设置 name 对象的对象映射图内 key 的值。
如果没加可选的 <em>value</em> 参数，
就从标准输入读取。</p>
</dd>
<dt><strong class="command">rmomapkey</strong> [ --omap-key-file <em>file</em> ] <em>name</em> <em>key</em></dt><dd><p>从 name 对象的对象映射图内删除 key 。</p>
</dd>
<dt><strong class="command">getomapheader</strong> <em>name</em></dt><dd><p>把 name 对象的对象映射图头部转储为十六进制。</p>
</dd>
<dt><strong class="command">setomapheader</strong> <em>name</em> <em>value</em></dt><dd><p>设置 name 对象的对象映射图头部的值。</p>
</dd>
<dt><strong class="command">export</strong> <em>filename</em></dt><dd><p>把存储池内容序列化为一个文件或标准输出。</p>
</dd>
<dt><strong class="command">import</strong> [--dry-run] [--no-overwrite] &lt; filename | - &gt;</dt><dd><p>把一个文件或标准输入的内容载入存储池。</p>
</dd>
</dl>
</section>
<section id="id9">
<h2>实例<a class="headerlink" href="#id9" title="Permalink to this heading"></a></h2>
<p>查看集群使用情况：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="n">df</span>
</pre></div>
</div>
<p>获取存储池 foo 内的对象列表，并显示在标准输出：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="o">-</span><span class="n">p</span> <span class="n">foo</span> <span class="n">ls</span> <span class="o">-</span>
</pre></div>
</div>
<p>获取 PG 0.6 内的一些对象：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="o">--</span><span class="n">pgid</span> <span class="mf">0.6</span> <span class="n">ls</span>
</pre></div>
</div>
<p>写入一个对象：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="o">-</span><span class="n">p</span> <span class="n">foo</span> <span class="n">put</span> <span class="n">myobject</span> <span class="n">blah</span><span class="o">.</span><span class="n">txt</span>
</pre></div>
</div>
<p>创建一个快照：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="o">-</span><span class="n">p</span> <span class="n">foo</span> <span class="n">mksnap</span> <span class="n">mysnap</span>
</pre></div>
</div>
<p>删除对象：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="o">-</span><span class="n">p</span> <span class="n">foo</span> <span class="n">rm</span> <span class="n">myobject</span>
</pre></div>
</div>
<p>读取对象先前的快照版内容：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="o">-</span><span class="n">p</span> <span class="n">foo</span> <span class="o">-</span><span class="n">s</span> <span class="n">mysnap</span> <span class="n">get</span> <span class="n">myobject</span> <span class="n">blah</span><span class="o">.</span><span class="n">txt</span><span class="o">.</span><span class="n">old</span>
</pre></div>
</div>
<p>罗列 PG 0.6 内不一致的对象：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rados</span> <span class="nb">list</span><span class="o">-</span><span class="n">inconsistent</span><span class="o">-</span><span class="n">obj</span> <span class="mf">0.6</span> <span class="o">--</span><span class="nb">format</span><span class="o">=</span><span class="n">json</span><span class="o">-</span><span class="n">pretty</span>
</pre></div>
</div>
</section>
<section id="id10">
<h2>使用范围<a class="headerlink" href="#id10" title="Permalink to this heading"></a></h2>
<p><strong>rados</strong> 是 Ceph 的一部分，这是个伸缩力强、开源、分布式的存储系统，更多信息参见 <a class="reference external" href="https://docs.ceph.com">https://docs.ceph.com</a> 。</p>
</section>
<section id="id11">
<h2>参考<a class="headerlink" href="#id11" title="Permalink to this heading"></a></h2>
<p><a class="reference internal" href="../ceph/"><span class="doc">ceph</span></a>(8)</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../osdmaptool/" class="btn btn-neutral float-left" title="osdmaptool -- ceph osd 运行图操作工具" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../ceph-post-file/" class="btn btn-neutral float-right" title="ceph-post-file -- 把文件上传给 ceph 开发者" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>